package com.wtwd.campus.dao;

import com.wtwd.campus.entity.WxUserStudentPermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ljiong
 * @date 2021/07/06
 * @description
 */
@Mapper
public interface WXUserStudentPermissionMapper {

    Integer unbindStudentAllParents(@Param("studentId") Integer studentId);

    Integer unbindWxUserByStudentIdAndWxUserId(@Param("studentId") Integer studentId,@Param("wxUserId") Integer wxUserId);

    /**
     * 查询学生和微信用户的关系
     * @param studentId
     * @param userId
     * @return
     */
    WxUserStudentPermission getWxUserStudentPermissionByCondition(@Param("studentId") Integer studentId, @Param("userId") Integer userId);

    /**
     * 添加学生和微信用户的绑定关系
     * @param studentId
     * @param userId
     * @return
     */
    int addWxUserStudentPermission(@Param("phone") String phone,@Param("studentId") Integer studentId, @Param("userId") Integer userId,@Param("isMan") Integer isMan,@Param("isAuthority") Integer isAuthority);

    /**
     * 解绑学生微信用户关联
     * @param studentId
     * @param userId
     * @return
     */
    int delWxUserStudentPermission(@Param("studentId") Integer studentId, @Param("userId") Integer userId);
}
